package lab02.Test06;

/**
 * Created by lady on 2017/10/14.
 */
public class Triangle {
    //属性：三个边，以及周长、面积
    double perimeter;
    double area;
    double sideA,sideB,sideC;
    Boolean t;

    //构造函数
    Triangle(double a,double b,double c){
        sideA=a;
        sideB=b;
        sideC=c;
        if(sideA+sideB>sideC&&sideA+sideC>sideB&&sideB+sideC>sideA){
            t=true;}
        else
            t=false;
    }
    //行为：周长、面积以及修改三个边
    double perimeter(){
        return sideC+sideB+sideA;
    }
    double area(){
        double m;
        m=(sideC+sideB+sideA)/2.0;
        return area=Math.sqrt(m*(m-sideA)*(m-sideB)*(m-sideC));
    }
}
